/*
 * @文件描述: 
 * @版本: 
 * @作者: 周晨阳
 * @Date: 2021-04-18 14:55:09
 */
#ifndef HOMEPAGE_H
#define HOMEPAGE_H

#include "typedef.h"
#include "public.h"

#define APP_HOMEPAGE 0
#define APP_MULTIMETER 1
#define APP_OSCILL 2

#define MODULE_OSCILL 1
#define MODULE_MULTIMETER 2
#define MODULE_KEYBOARD 3

#define CONNECTED 1
#define DISCONNECTED 0
//OSCILL_CHECK
#define OSCILL_CHECK_GPIO_PIN GPIO_Pin_8
#define OSCILL_CHECK_GPIO_PORT GPIOG
#define OSCILL_CHECK_GPIO_CLK RCC_AHB1Periph_GPIOG

//multimeter_CHECK
#define MULTIMETER_CHECK_GPIO_PIN GPIO_Pin_6
#define MULTIMETER_CHECK_GPIO_PORT GPIOG
#define MULTIMETER_CHECK_GPIO_CLK RCC_AHB1Periph_GPIOG

//KEYBOARD_CHECK
#define KEYBOARD_CHECK_GPIO_PIN GPIO_Pin_13
#define KEYBOARD_CHECK_GPIO_PORT GPIOB
#define KEYBOARD_CHECK_GPIO_CLK RCC_AHB1Periph_GPIOB

void homePageInit(uint8_t mode);
void enterMode(uint8_t mode);
void backToHome(uint8_t lastMode);
uint8_t getCurrentApp(void);
void moduleCheckInit();
void setModuleCheckingCb(void (*moduleCheckingCb)(uint8_t, uint8_t));
void moduleChecking(void);
uint8_t getModuleState(uint8_t module);
#endif